package ou;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Qualifier;
import org.springframework.stereotype.Component;

@Component
public class LiuBei {

    private String name="刘皇叔";

    @Autowired
    @Qualifier("doubleSword")
    private Weapon weapon;

    public void fight(){
        System.out.println(name+"使用"+weapon+"战斗");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public Weapon getWeapon() {
        return weapon;
    }

    public void setWeapon(Weapon weapon) {
        this.weapon = weapon;
    }
}
